@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'MINUS TEST'
@Metadata.ignorePropagatedAnnotations: true
define root view entity YMOON_060_CDS as select from I_ManufacturingOrder as HEAD
left outer join I_ManufacturingOrderItem as ITEM on  ITEM.ManufacturingOrder   = HEAD.ManufacturingOrder
{
    key HEAD.ManufacturingOrder,

    HEAD.ProductionUnit,
    @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
    HEAD.MfgOrderPlannedTotalQty,
    @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
    ITEM.MfgOrderItemPlannedTotalQty,
    @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
    ITEM.MfgOrderItemGoodsReceiptQty,
    @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
    HEAD.MfgOrderPlannedTotalQty - ITEM.MfgOrderItemPlannedTotalQty as QTY1,
    @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
    HEAD.MfgOrderPlannedTotalQty - ITEM.MfgOrderItemGoodsReceiptQty as QTY2,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
    cast(coalesce(HEAD.MfgOrderPlannedTotalQty, 100) as abap.quan( 17, 3 )) as qty
}
